const mysql = require('mysql');
const pool  = mysql.createPool({
    user:"root",
    password:"root",
    database:"0919",
    host:"localhost",
    port:3306
})

function exec(sql){
    return new Promise((resolve,reject)=>{
        pool.query(sql,(err,data)=>{
            if(err){
                reject(err)
            }else{
                resolve(data)
            }
        })
    })
}

module.exports = {
    exec
}